package com.itheima.domain;

import java.util.TreeSet;

public class AgeSort {
    public static void main(String[] args) {
        TreeSet<Student> ts = new TreeSet<>();
        Student s1 = new Student("zhangsan",23);
        Student s2 = new Student("lisi",28);
        Student s3 = new Student("wangwu",30);
        Student s4 = new Student("zhaoliu",32);
        Student s5 = new Student("xiaoli",20);

        ts.add(s1);
        ts.add(s2);
        ts.add(s3);
        ts.add(s4);
        ts.add(s5);

        System.out.println(ts);


    }
}
